﻿//using System;
//using System.Linq;
//using System.Collections.Generic;
//using System.Data.Entity;

//namespace MVCBootstrap.EntityFramework {

//    public class RepositoryFactories {
//        private readonly IDictionary<Type, Func<DbContext, Object>> repositoryFactories;

//        public RepositoryFactories(IEnumerable<ISpecializedRepository> specialReps) {
//            // TODO: Chicken and egg..!!
//            this.repositoryFactories = specialReps.ToDictionary(key => typeof(key), key => dbContext => new 
//        }

//        public Func<DbContext, Object> GetRepositoryFactory<T>() {
//            Func<DbContext, Object> factory;
//            this.repositoryFactories.TryGetValue(typeof(T), out factory);
//            return factory;
//        }

//        public Func<DbContext, Object> GetRepositoryFactoryForEntityType<T>() where T : class {
//            return this.GetRepositoryFactory<T>() ?? this.DefaultEntityRepositoryFactory<T>();
//        }

//        protected virtual Func<DbContext, Object> DefaultEntityRepositoryFactory<T>() where T : class {
//            return dbContext => new Repository<T>(dbContext);
//        }
//    }
//}